package com.twt.survey.utils;

import com.twt.survey.common.BaseResponse;
import com.twt.survey.common.ErrorCode;

public class ResultUtils {
    public static <T> BaseResponse<T> success(T data) {
        return new BaseResponse<>(data, ErrorCode.SUCCESS);
    }

    public static <T> BaseResponse<T> fail(ErrorCode errorCode, String description) {
        return new BaseResponse<>(errorCode, description);
    }

    public static <T> BaseResponse<T> error(ErrorCode errorCode, String description) {
        return new BaseResponse<>(errorCode, description);
    }
}
